﻿<Window x:Class="SampleProject.TabItemsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tab="http://fabtab.codeplex.com"
    Title="TabItemsWindow" xmlns:local="clr-namespace:SampleProject"
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    Height="600" Width="800">
    <Window.Resources>
        <LinearGradientBrush EndPoint="1,0" x:Key="mask">
            <LinearGradientBrush.Transform>
                <RotateTransform Angle="10"/>
            </LinearGradientBrush.Transform>
            <GradientStop Offset="0" Color="White"/>
            <GradientStop Offset="0.1" />
        </LinearGradientBrush>
        
        <Style TargetType="{x:Type tab:FabTabItem}">
            <Setter Property="Header" Value="{Binding Path=LabelText,diagnostics:PresentationTraceSources.TraceLevel=High}"/>
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{Binding}"/>

                        </StackPanel>

                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <DockPanel>
        <StackPanel Orientation="Vertical" DockPanel.Dock="Right" >
            <Button Content="Add Tab" Click="Button_Click"/>
            <Button Content="Open CancelCloseEventWindow" Click="Button_Click_1"/>
            <Button Content="Open ItemsSourceWindow" Click="Button_Click_2"/>
            <Button Content="Open No ContentTab Window" Click="Button_Click_3"/>
            <Button Content="Open NonClosableTab Window" Click="Button_Click_4"/> 
            <Button Content="Open NoXaml Window" Click="Button_Click_5"/>
            <Button Content="MVVM Window" Click="Button_Click_6"/> 
            <Button Content="Add TabItem With Custom Header" Click="Button_Click_7"/>
        </StackPanel>
        <tab:FabTabControl DockPanel.Dock="Left" x:Name="tabControl" MinWidth="300" 
                           ContentOpacityMask="{StaticResource mask}" ShowDefaultTransitionAnimation="False"
                           >
            <tab:FabTabControl.Triggers>
                <EventTrigger RoutedEvent="Selector.SelectionChanged">
                    <BeginStoryboard>
                        <Storyboard AutoReverse="False">
                            <tab:EasingDoubleAnimation Storyboard.TargetProperty="ContentOpacityMask.Transform.Angle"
                                                 Storyboard.TargetName="tabControl"
                                                     To="-90" From="10" Duration="0:0:0.7"
                                                       Equation="BackEaseInOut"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </tab:FabTabControl.Triggers>
            <tab:FabTabControl.Items>
                <tab:FabTabItem Header="My View 1">
                    <local:SampleView LabelText="View 1"/>
                </tab:FabTabItem>
                <tab:FabTabItem Header="My View 2">
                    <local:SampleView LabelText="View 2"/>
                </tab:FabTabItem>
                <tab:FabTabItem Header="My View 3">
                    <local:SampleView LabelText="View 3"/>
                </tab:FabTabItem>
                <local:SampleView LabelText="Oddball View"/>
            </tab:FabTabControl.Items>
        </tab:FabTabControl>
        
        

    </DockPanel>
</Window>
